public class BleInterface extends PrinterInterface
connectListener
Constructor and Description |
---|
BleInterface() |
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.Object object)
Connect printer device
连接打印机 |
void |
disConnect()
Interrupt connection
断开连接 |
ConnectStateEnum |
getConnectState()
Get connect state
获取连接状态 |
boolean |
getisAlwaysReadInputStream() |
boolean |
getIsPrinting() |
byte[] |
readMsg()
Read the messages from the printer
读取打印机的回传信息 |
void |
setAlwaysReadInputStream(boolean alwaysReadInputStream) |
void |
setPrintListener(PrintListener printListener) |
void |
writeMsg(byte[] btCmds)
Send byte array to the printer(Run in Main Thread)
发送指令到打印机(主线程中运行) |
void |
writeMsgAsync(byte[] btCmds)
Send byte array to the printer(Run in Sub-Thread)
发送指令到打印机(子线程中运行) |
getConfigObject, getmName, setConfigObject, setConnectListener, setmName
public void connect(java.lang.Object object)
PrinterInterface
connect
in class PrinterInterface
object
- BluetoothEdrConfigBean, WiFiConfigBean, UsbConfigBeanpublic void disConnect()
PrinterInterface
disConnect
in class PrinterInterface
public ConnectStateEnum getConnectState()
PrinterInterface
getConnectState
in class PrinterInterface
public void writeMsg(byte[] btCmds)
PrinterInterface
writeMsg
in class PrinterInterface
btCmds
- commnads , 指令public void writeMsgAsync(byte[] btCmds)
PrinterInterface
writeMsgAsync
in class PrinterInterface
btCmds
- commnads , 指令public byte[] readMsg()
PrinterInterface
readMsg
in class PrinterInterface
public boolean getIsPrinting()
getIsPrinting
in class PrinterInterface
public void setPrintListener(PrintListener printListener)
setPrintListener
in class PrinterInterface
public void setAlwaysReadInputStream(boolean alwaysReadInputStream)
setAlwaysReadInputStream
in class PrinterInterface
public boolean getisAlwaysReadInputStream()
getisAlwaysReadInputStream
in class PrinterInterface